<?php
/**
 *
 *@package 
 *@copyright Copyright (c) 2012-2014 Tuniu.com
 *@author huxiaomin 2012
 *@version 1.0
 */
define('T_SLASH', DIRECTORY_SEPARATOR);
define('TT_DIR',dirname(__FILE__).'/');  
define('LOCAL_HOST', 'http://www.tframe.com');


define('TFRAME_SUFFIX', '.cls.php');
define('TAPP_SUFFIX', '.app.php');//App
define('TFRAME_DIR',TT_DIR.'frame/');

define('TWEB_DIR',TT_DIR.'web/');
define('TAPP_DIR',TWEB_DIR.'app/');
define('TCACHE_DIR',TWEB_DIR.'cache/');
define('TLOG_DIR',TWEB_DIR.'log/');
define('TTPL_DIR',TWEB_DIR.'tpl/');

define('TMOD_DIR',TT_DIR.'mod/');
define('TMOD_SUFFIX', '.mod.php');//Mod

define('TTABLE_DIR',TT_DIR.'table/');
define('TTABLE_SUFFIX', '.table.php');//Table

define('TPLUGIN_DIR',TT_DIR.'com/plugin/');
define('TPLUGIN_SUFFIX', '.plugin.php');//Plugin


define('TAPP_INDEX','/admin/a-login/index'); //默认api
define ('T_RECEIVE_HTTP', '/restful/interface/index');
define ('T_CALLBACK_HTTP', '/restful/interface/callback');
define ('T_EXEC_HTTP', '/restful/interface/exec');
define('TTESTCODE_HTTP','/test.code.php'); //默认testcode api


//--------------------smarty--------------------//

define('TTPL_SMARTY_DIR',TT_DIR.'smarty/');
ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.TTPL_SMARTY_DIR.PATH_SEPARATOR.TT_DIR);

global $_CONFIG;
$_CONFIG['cache_lifetime'] = 0;
$_CONFIG['template_dir'] = TTPL_DIR;
$_CONFIG['smarttemplate_compiled'] = TWEB_DIR . 'template_c';
$_CONFIG['extension_dir'] = TTPL_SMARTY_DIR . 'smarttemplate_extensions';
//--------------------smarty--------------------//

define('TCACHE_OPEN', 1);//文件输出缓存是否开启。

date_default_timezone_set('Asia/Shanghai'); 
define('DEBUG_TYPE',  1);//0上线模式，1开发模式，
define('DEBUG_PRINT', 1);//gprint_r 是否打印自己的调试 

if (DEBUG_TYPE == 1){
    ini_set('display_errors',1);
    error_reporting(E_ERROR & ~E_NOTICE);
    //error_reporting(E_ALL);
}
require_once TFRAME_DIR.'TDefault.cls.php';
require_once TFRAME_DIR.'memcache/TMemcache.cls.php';
require_once TFRAME_DIR.'TImport.cls.php';
require_once TFRAME_DIR.'TAutoload.cls.php';
spl_autoload_register('TAutoload::load');
TImport::import('com/lib','.php');


//数据库
define ('D_DAO','dbschema=d&dbuser=root&dbpass=&dbhost=127.0.0.1&dbport=3306');
$slave_daos = array('dbschema=d&dbuser=root&dbpass=&dbhost=127.0.0.1&dbport=3306',
                    'dbschema=d&dbuser=root&dbpass=&dbhost=127.0.0.1&dbport=3306',
                    'dbschema=d&dbuser=root&dbpass=&dbhost=127.0.0.1&dbport=3306',);
define('D_DAO_SLAVE',json_encode($slave_daos));
unset($slave_daos);

//memcache设置
$servers = array(array('127.0.0.1',11211),array('127.0.0.1',11211),array('127.0.0.1',11211),);
define('D_MEMCACHE_CONFIG', json_encode($servers));
unset($servers);
define('D_MEMCACHE_NUMS', 3);



    